import request from "@/utils/request";
import {tansParams} from "@/utils/common";

/**
 * 特征值
 * @param query
 * @returns { "code": 200, data: {"eventTime":[],"x":[],"y":[],"z":[],"overall":[]}, "msg": "操作成功" }
 */
export function queryFeature(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryFeature?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}

/**
 * 查询平滑值
 * @param query
 * @returns { "code": 200, data: {"eventTime":[],"x":[],"y":[],"z":[],"overall":[]}, "msg": "操作成功" }
 */
export function queryEmaFeature(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryEmaFeature?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}

/**
 * 查询阈值
 * @param query
 * @returns { "code": 200, data: {"eventTime":[],"xThresholdB":[],"xThresholdC":[],"xThresholdD":[],"yThresholdB":[],"yThresholdC":[],"yThresholdD":[],"zThresholdB":[],"zThresholdC":[],"zThresholdD":[]}, "msg": "操作成功" }
 */
export function queryThreshold(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryThreshold?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}


/**
 * 查询幅值
 * @param query
 * @returns { "code": 200, data:{"eventTime":[],"x":[],"y":[],"z":[],"overall":[]}, "msg":"操作成功" }
 */
export function queryAmp(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryAmp?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}

/**
 * 查询幅值的平滑值
 * @param query
 * @returns { "code": 200, data: {"eventTime":[],"x":[],"y":[],"z":[],"overall":[]}, "msg": "操作成功" }
 */
export function queryAmpEma(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryAmpEma?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}

/**
 * 查询幅值的阈值
 * @param query
 * @returns { "code": 200, data: {"xEventTime":[],"xThresholdB":[],"xThresholdC":[],"xThresholdD":[],"yEventTime":[],"yThresholdB":[],"yThresholdC":[],"yThresholdD":[],"zEventTime":[],"zThresholdB":[],"zThresholdC":[],"zThresholdD":[]}, "msg": "操作成功" }
 */
export function queryAmpThreshold(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryAmpThreshold?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}

/**
 * 查询报警信息
 * @param query { "pageNum": 1, "pageSize": 10, "equipmentCode": "" }
 * @returns { "code": 200, "total":1, "rows": [{},{}], "msg": "操作成功" }
 */
export function queryAlarm(query) {
    let url = "/proxy?url=" + encodeURIComponent("/api/freq/queryAlarm?" + tansParams(query));
    return request({
        url: url,
        method: 'get'
    })
}